﻿using System;
using System.Data;

namespace WinFormClient
{
    public class ColumnMap
    {
        string _columnName;
        string _dbDataType;
        string _fieldName;
        string _csDataType;
        int _dataLength;
        string _comments;
        string _indexName = null;
        string _defaultValue = null;
        bool _notNull = false;

        public ColumnMap(
            string columnName,
            string dbDataType,
            string fieldName,
            string csDataType,
            int dataLength,
            string comments,
            string indexName,
            string defaultValue,
            int visibleIndex,
            string visible,
            string editable,
            string control,
            string spin,
            string propertyName,
            bool notNull)
        {
            this._columnName = columnName;
            this._dbDataType = dbDataType;
            this._fieldName = fieldName;
            this._csDataType = csDataType;
            this._dataLength = dataLength;
            this._comments = comments.Replace("\n", "\n///");
            this._indexName = indexName;
            this._defaultValue = defaultValue;
            this._visibleIndex = visibleIndex;
            this._visible = visible;
            this._editable = editable;
            this._control = control;
            this._spin = spin;
            this._propertyName = propertyName;
            this._notNull = notNull;
        }

        public string ColumnName
        {
            get { return this._columnName; }
        }


        public string DbDataType
        {
            get { return this._dbDataType; }
        }


        public string FieldName
        {
            get { return this._fieldName; }
        }


        public string CsDataType
        {
            get { return this._csDataType; }
        }

        public int DataLength
        {
            get { return this._dataLength; }
        }

        public string Comments
        {
            get { return this._comments; }
        }

        public string IndexName
        {
            get { return this._indexName; }
        }

        public string Defaultvalue
        {
            get { return this._defaultValue; }
        }

        int _visibleIndex = 3;
        string _visible;
        string _editable;
        string _control;
        string _spin;
        string _propertyName;
        public int VisibleIndex
        {
            get { return this._visibleIndex; }
        }

        public string Visibility
        {
            get { return this._visible; }
        }

        public string Editable
        {
            get { return this._editable; }
        }

        public string DevGridControl
        {
            get { return this._control; }
        }

        public string Spin
        {
            get { return this._spin; }
        }

        public string PropertyName
        {
            get { return this._propertyName; }
        }

        public bool NotNull { get { return this._notNull; } }
    }
}
